<template>
  <div>
    <van-collapse v-model="activeNames">
      <van-collapse-item :title="i.name" :name="i.id" v-for="i in menulist" :key="i.id">
        <van-sidebar v-model="index">
          <van-sidebar-item :title="j.name" v-for="j in i['child']" :key="j.id" @click="changeid(j.id)" />
        </van-sidebar>
      </van-collapse-item>

    </van-collapse>
<!--    <van-collapse v-model="activeNames">-->
<!--      <van-collapse-item title="组织用户" name="1">-->
<!--        <van-sidebar v-model="index" @change="change">-->
<!--          <van-sidebar-item title="组织管理" />-->
<!--          <van-sidebar-item title="用户管理" />-->
<!--          <van-sidebar-item title="职务管理" />-->
<!--          <van-sidebar-item title="岗位管理" />-->
<!--        </van-sidebar>-->
<!--      </van-collapse-item>-->
<!--      <van-collapse-item title="菜单权限" name="2">-->
<!--        <van-sidebar v-model="index1" @change="change1" >-->
<!--          <van-sidebar-item title="角色管理" />-->
<!--          <van-sidebar-item title="角色授权" />-->
<!--          <van-sidebar-item title="菜单管理" />-->
<!--        </van-sidebar>-->
<!--      </van-collapse-item>-->
<!--      <van-collapse-item title="应用管理" name="3">-->
<!--        <van-sidebar v-model="index2" >-->
<!--          <van-sidebar-item title="标签名1" />-->
<!--          <van-sidebar-item title="标签名2" />-->
<!--          <van-sidebar-item title="标签名3" />-->
<!--        </van-sidebar>-->
<!--      </van-collapse-item>-->
<!--      <van-collapse-item title="工作配置" name="4">-->
<!--        <van-sidebar v-model="index3" @change="change3">-->
<!--          <van-sidebar-item title="工作流模板" />-->
<!--          <van-sidebar-item title="工作流展示" />-->
<!--        </van-sidebar>-->
<!--      </van-collapse-item>-->
<!--      <van-collapse-item title="配置管理" name="5">-->
<!--        <van-sidebar v-model="index" >-->
<!--          <van-sidebar-item title="标签名1" />-->
<!--          <van-sidebar-item title="标签名2" />-->
<!--          <van-sidebar-item title="标签名3" />-->
<!--        </van-sidebar>-->
<!--      </van-collapse-item>-->
<!--      <van-collapse-item title="系统监控" name="6">-->
<!--        <van-sidebar v-model="index" >-->
<!--          <van-sidebar-item title="标签名1" />-->
<!--          <van-sidebar-item title="标签名2" />-->
<!--          <van-sidebar-item title="标签名3" />-->
<!--        </van-sidebar>-->
<!--      </van-collapse-item>-->
<!--      <van-collapse-item title="系统工具" name="7">-->
<!--        <van-sidebar v-model="index" >-->
<!--          <van-sidebar-item title="标签名1" />-->
<!--          <van-sidebar-item title="标签名2" />-->
<!--          <van-sidebar-item title="标签名3" />-->
<!--        </van-sidebar>-->
<!--      </van-collapse-item>-->
<!--    </van-collapse>-->
  </div>
</template>
<script>
// import { Notify } from 'vant';
import myaxios from "../../../https/myaxios";
export default {
  name: "myleft",
  data(){
    return{
      index:'',
      index1:'',
      index3:'',
      activeNames:["1"],
      menulist:[],
    }
  },
  methods:{
    getdata(){
      myaxios("menu_auth?userid="+localStorage.getItem("userid"),"get").then(res=>{
        this.menulist=res.list
        console.log(this.menulist)
      })
    },
    changeid(i){
      // alert(i)
      this.$emit('get-id',i)
    },
    change(index) {
      // this.index = index
      console.log(index)
      // alert(val)
      this.$emit('get-id',index)
      // Notify({ type: 'primary', message: index });
    },
    // change1(index1) {
    //   this.$emit('get-id',index1+4)
    // },
    // change3(index3) {
    //   this.$emit('get-id',index3+10)
    // }
  },
  mounted() {
    this.getdata()
  }
}
</script>

<style scoped>

</style>